Fixes, move spinlock to cc, minor changes#42
Open
jkunstwald wants to merge 66 commits intodevelopfrom
Open
Conversation
| ::DWORD length = 0; | ||
| std::byte buffer_stack[4096]; | ||
| cc::array<std::byte> buffer_heap; | ||
| DWORD buffer_length = CC_COUNTOF(buffer_stack); |
Contributor
There was a problem hiding this comment.
hm, could we think about renaming CC_COUNTOF? it's a bit too short and ambiguous for my tastes. especially for something that is actually not used that often
| #include <task-dispatcher/common/system_info.hh> | ||
|
|
||
| // the size of a task in cachelines (= 64B) | ||
| #define TD_FIXED_TASK_SIZE 2 |
Contributor
There was a problem hiding this comment.
this is not really public api, right? and does it have to be a macro? a detail:: constexpr/enum value might be a better fit
Contributor
Author
There was a problem hiding this comment.
Yeah, was thinking of making it a CMake exposed option at the time but an enum val is just as good for now
src/task-dispatcher/scheduler.cc
Outdated
| resumable_fiber_mpsc_queue pinned_resumable_fibers = {}; | ||
| // note that this queue uses a spinlock instead of being lock free (TODO) | ||
| SpinLock pinned_resumable_fibers_lock = {}; | ||
| cc::spin_lock pinned_resumable_fibers_lock = {}; |
src/task-dispatcher/td-lean.hh
Outdated
| batch < num_batches; // | ||
| ++batch, start = batch * batch_size, end = cc::min((batch + 1) * batch_size, num_elements)) | ||
| { | ||
| tasks[batch].lambda([=] { func(start, end, batch); }); |
Contributor
There was a problem hiding this comment.
is this by design that the func is copied?
Contributor
Author
There was a problem hiding this comment.
Yes, the task is persisted, the original lambda will be dead once it's executed
…on a different thread
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cc::spin_lock)num_physical_cores